import 'package:app/common/app_theme.dart';
import 'package:app/common/colors.dart';
import 'package:app/common/tool.dart';
import 'package:app/components/base_scaffold_appbar.dart';
import 'package:app/pages/timesheet_module/timesheet_detail_module/timesheet_detail_controller.dart';
import 'package:app/utils/search_module.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:get/get.dart';

class TimeSheetDetailView extends GetView{


  TimeSheetDetailController controller = Get.put(TimeSheetDetailController());



  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      backgroundColor: AppColor.bgColor,
      appBar: BaseAppBar(
        preferredSize: Size(Get.width, AppTool.appBarHEIGHT),
        child: Text('详情'),
      ),
      body: GetBuilder<TimeSheetDetailController>(builder: (_){
        return SafeArea(child: Column(
          children: [
            Expanded(child: ListView(
              padding: EdgeInsets.only(left: 0),
              children: [

                SizedBox(height: 25,),

                Container(
                  padding: EdgeInsets.only(left: 15,bottom: 5),
                  child: Text('工时单',style: appThemeData.textTheme.subtitle1!.copyWith(fontSize: 14),),
                ),
                Container(
                  padding: EdgeInsets.only(left: 15),
                  height: 45,
                  color: Colors.white,
                  alignment: Alignment.centerLeft,
                  child: Text('${controller.model?.data?.name??''}',style: appThemeData.textTheme.bodyText1!.copyWith(fontSize: 15),),
                ),

                SizedBox(height: 10,),

                Container(
                  padding: EdgeInsets.only(left: 15),
                  height: 80,
                  color: Colors.white,
                  child:Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text('项目名称',style: appThemeData.textTheme.subtitle1!.copyWith(fontSize: 14),),
                      Text('${controller.model?.data?.projectName}',style: appThemeData.textTheme.bodyText1!.copyWith(fontSize: 15),),
                    ],
                  ),
                ),

                SizedBox(height: 10,),

                Container(
                  padding: EdgeInsets.only(left: 15),
                  height: 55,
                  color: Colors.white,
                  child:Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text('任务名称',style: appThemeData.textTheme.subtitle1!.copyWith(fontSize: 14),),
                      Text('${controller.model?.data?.taskName}',style: appThemeData.textTheme.bodyText1!.copyWith(fontSize: 15),),
                    ],
                  ),
                ),
                SizedBox(height: 10,),
                Container(
                  padding: EdgeInsets.only(left: 15,right: 15),
                  height: 45,
                  alignment: Alignment.centerLeft,
                  color: Colors.white,
                  child:Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Text('时间',style: appThemeData.textTheme.subtitle1!.copyWith(fontSize: 14),),
                      Text('${controller.model?.data?.date}',style: appThemeData.textTheme.bodyText1!.copyWith(fontSize: 15),),
                    ],
                  ),
                ),
                SizedBox(height: 10,),
                Container(
                  padding: EdgeInsets.only(left: 15,right: 15),
                  height: 45,
                  alignment: Alignment.centerLeft,
                  color: Colors.white,
                  child:Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Text('时长',style: appThemeData.textTheme.subtitle1!.copyWith(fontSize: 14),),
                      Text('${controller.model?.data?.workHour}',style: appThemeData.textTheme.bodyText1!.copyWith(fontSize: 15),),
                    ],
                  ),
                ),
                SizedBox(height: 10,),
                Container(
                  padding: EdgeInsets.only(left: 15,right: 15),
                  height: 45,
                  alignment: Alignment.centerLeft,
                  color: Colors.white,
                  child:Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Text('用户',style: appThemeData.textTheme.subtitle1!.copyWith(fontSize: 14),),
                      Text('${controller.model?.data?.userName}',style: appThemeData.textTheme.bodyText1!.copyWith(fontSize: 15),),
                    ],
                  ),
                ),

              ],
            )),
          ],
        ));
      }),
    );
  }

}